<?php
class GroupAuthorityRepository {

    var $db;

    public function GroupAuthorityRepository() {
        global $SERVER, $DATABASE, $USERNAME, $PASSWORD;
        $this->db = new Connection($SERVER, $DATABASE, $USERNAME, $PASSWORD);
    }
    
    function CheckExistGroupAuthority($groupID, $authorityID)
    {
        $query = "SELECT * FROM group_authority WHERE GroupID_i = " . $groupID . " and AuthorityID_i = " . $authorityID;
        $result = $this->db->ExecuteQuery($query);
        if ($result) {
            if ($row = mysql_fetch_array($result, MYSQL_NUM)) return true;
        }
        return false;
    }

}


?>
